package Modules
{
	import mx.utils.ObjectUtil;
	
	public class NavigationInfo
	{
		private var _sourceND:NavigationDetails;
		private var _destinationND:NavigationDetails;
		private var _data:Object;
		private var _previous:NavigationInfo = null;
		
		public function NavigationInfo(sourceNavDetails:NavigationDetails, destinationNavDetails:NavigationDetails, data:Object = null)
		{
			_sourceND = sourceNavDetails;
			_destinationND = destinationNavDetails;
			_data = data;
		}
		
		public function get sourceNavObj():NavigationDetails{
			return _sourceND;
		}

		public function get destinationNavObj():NavigationDetails{
			return _destinationND;
		}
		
		public function get dataObj():Object{
			return _data;
		}
		
		public function get previousLink():NavigationInfo{
			return _previous;
		}

		public function set previousLink(value:NavigationInfo):void{
			this._previous = value;
		}
		
		public function copy():NavigationInfo{
			var newNI:NavigationInfo = new NavigationInfo(this.sourceNavObj.copy(),this.destinationNavObj.copy(),ObjectUtil.copy(this.dataObj));
			newNI.previousLink = (this.previousLink == null)?null:this.previousLink.copy();
			
			return newNI;
		}

	}
}